//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//

package com.aidong.dao.wills;

import com.aidong.dao.base.ConditionMap;
import com.aidong.dao.base.Pagination;
import com.aidong.dao.wills.BaseDao;
import com.aidong.model.wills.PssProductSaleList;
import com.aidong.model.wills.PssProductSaleListTotal;
import java.util.ArrayList;
import org.springframework.stereotype.Repository;

@Repository
public class PssProductSaleListDao extends BaseDao<PssProductSaleList, Integer> {
    public PssProductSaleListDao() {
    }

    public void getLstSale(Pagination<PssProductSaleListTotal> pagination, ConditionMap cd) {
        ArrayList params = new ArrayList();
        String sqlw = cd.toSql(params);
        String sql = "select a.ShopCode,a.AutoId,a.SaleDate,b.ProductCode, \nc.Unit,c.productType,b.Quantity,b.Price,(b.Quantity*b.Price) as Amount,a.SaleCode, \na.CreateUser as UserCode \nfrom PssProductSale a inner join PssProductSaleList b on a.AutoId=b.ProductSaleId and a.ShopCode=b.ShopCode \nleft join PssProductCode c on b.ProductCode=c.ProductCode \n" + (sqlw.length() > 0?"where " + sqlw:"");
        sql = sql + "  order by a.AutoId \n";
        this.queryPageListBySql(PssProductSaleListTotal.class, pagination, sql, params.toArray());
    }
}
